Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 9: Sensing Viewer Actions

../ch09/09fig05.gif
Figure 9.5

Four stacking blocks.

09fig05.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
        Group {
            children [
                DEF Block1 Transform {
                    children DEF BlockShape Shape {
                        appearance Appearance {
                            material Material { }
                        }
                        geometry Box { }
                    }
                },
                DEF Block1Sensor PlaneSensor {
                    offset 0.0 0.0 0.0
                }
            ]
        },
        Group {
            children [
                DEF Block2 Transform {
                    translation 2.5 0.0 0.0
                    children USE BlockShape
                },
                DEF Block2Sensor PlaneSensor {
                    offset 2.5 0.0 0.0
                }
            ]
        },
        Group {
            children [
                DEF Block3 Transform {
                    translation 1.5 2.0 0.0
                    children USE BlockShape
                },
                DEF Block3Sensor PlaneSensor {
                    offset 1.5 2.0 0.0
                }
            ]
        },
        Group {
            children [
                DEF Block4 Transform {
                    translation 0.75 4.0 0.0
                    children USE BlockShape
                },
                DEF Block4Sensor PlaneSensor {
                    offset 0.75 4.0 0.0
                }
            ]
        }
    ]
}
ROUTE Block1Sensor.translation_changed TO Block1.set_translation
ROUTE Block2Sensor.translation_changed TO Block2.set_translation
ROUTE Block3Sensor.translation_changed TO Block3.set_translation
ROUTE Block4Sensor.translation_changed TO Block4.set_translation